﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;

namespace AmbientLight
{
    public class LED
    { 
        public void SetColor(int r, int g, int b)
        {
            SerialPort sp = new SerialPort("COM7", 9600);
            sp.Open();
            sp.Write(new Byte[] {0xFF },0,1);
            sp.Write(new Byte[] { (Byte)(r) }, 0, 1);
            sp.Write(new Byte[] { (Byte)(g) }, 0, 1);
            sp.Write(new Byte[] { (Byte)(b) }, 0, 1);
            sp.Close();
        }
    }
}
